//
//  ChooseCardViewController.m
//  TenThousand
//
//  Created by 我的 on 16/6/21.
//  Copyright © 2016年 baixue. All rights reserved.
//

#import "ChooseCardViewController.h"
#import "ChooseCardTableViewCell.h"
#import "AddViewController.h"

@interface ChooseCardViewController ()<UITableViewDelegate,UITableViewDataSource>

@end

@implementation ChooseCardViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"请选择银行";
    [self createLeft:[UIImage imageNamed:@"ZHSZicon_03"] leftClick:^{
        [self.navigationController popViewControllerAnimated:YES];
    } right:nil rightClick:nil];
    [self chooseTableView];
}

- (UITableView *)chooseTableView{
    _chooseTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, Screen_Width, Screen_Height) style:UITableViewStylePlain];
    _chooseTableView.delegate = self;
    _chooseTableView.dataSource = self;
    _chooseTableView.separatorStyle = NO;
    [self.view addSubview:_chooseTableView];
    return _chooseTableView;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 9;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    ChooseCardTableViewCell *chooseCardCell = [tableView dequeueReusableCellWithIdentifier:@"CHOOSECARDCELL"];
    if (chooseCardCell == nil) {
        chooseCardCell = [[[NSBundle mainBundle] loadNibNamed:@"ChooseCardTableViewCell" owner:nil options:nil] lastObject];
    }
    chooseCardCell.selectionStyle = UITableViewCellSelectionStyleNone;
    return chooseCardCell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 80;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    AddViewController *addView = [[AddViewController alloc] init];
    [self.navigationController pushViewController:addView animated:YES];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}


@end
